using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using FileHelpers.RunTime;
using System.Xml.Serialization;
using Fireball.CodeEditor.SyntaxFiles;
using System.Diagnostics;

namespace FileHelpers.WizardApp
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public class frmWizard : System.Windows.Forms.Form
    {
        #region "  Autogenerated  "

        private Panel panStep1;
        private Label label1;
        private Panel panStep3;
        private Label label2;
        private GroupBox groupBox2;
        private NumericUpDown txtNumberOfFields;
        private Label label6;
        private PictureBox picFirstDark;
        private Panel panel1;
        private PictureBox picCurrStep;
        private Label lblStep0;
        private Label lblStep1;
        private PictureBox pictureBox1;
        private PictureBox pictureBox3;
        private FlowLayoutPanel panFields;
        private Label label9;
        private ComboBox txtDefaultType;
        private Label label10;
        private ComboBox cboFieldVisibility;
        private Panel panStep0;
        private GroupBox groupBox5;
        private TextBox txtClassName;
        private GroupBox groupBox8;
        private TextBox txtDelimiter;
        private RadioButton radDelimited;
        private RadioButton radFixed;
        private Label label18;
        private RadioButton radDelVertBar;
        private RadioButton radDelComma;
        private RadioButton radDelSemiCol;
        private RadioButton radDelCustom;
        private RadioButton radDelTabs;
        private GroupBox gbxDelimitedBy;
        private Panel panStep2;
        private Button cmdAddField;
        private Label label15;
        private ComboBox cboTemplate;
        private Button cmdSaveToFile;
        private Button cmdToClipboard;
        private Label label3;
        private ComboBox cboLanguage;
        private Label label4;
        private SaveFileDialog dlgSaveToFile;
        private PictureBox pictureBox5;
        private Label lblStep2;
        private Label lblStep3;
        private Button cmdReset;
        private Button cmdNext;
        private Button cmdBack;
        private Button cmdPreview;
        private Panel panel2;
        private Panel panPreview;
        private Button cmdSaveClass;
        private Button cmdCopyClass;
        private Label label5;
        private PictureBox pictureBox4;
        private ComboBox cboClassLeng;
        private Label label7;
        private Button cmdSave;
        private SaveFileDialog dlgSaveWizard;
        private Button cmdLoad;
        private GroupBox groupBox1;
        private NumericUpDown txtIgnoreLast;
        private Label label14;
        private Label label16;
        private NumericUpDown txtIgnoreFirst;
        private Label label17;
        private Label label20;
        private GroupBox groupBox3;
        private Fireball.Windows.Forms.CodeEditorControl txtTemplOut;
        private IContainer components;
        private Fireball.Syntax.SyntaxDocument sdTemplOut;
        private Fireball.Windows.Forms.CodeEditorControl txtOutput;
        private Fireball.Syntax.SyntaxDocument sdClassOut;
        private ToolTip toolTip1;
        private CheckBox chkProperties;
        private CheckBox chkIgnoreEmpty;
        private Button cmdTestClass;
        private NumericUpDown txtFieldLength;
        private Label label11;
        private PictureBox picDonate;
        private Label linkHome;
        private PictureBox picNewVersion;
        private PictureBox picCurrent;
        private Label label12;
        private ComboBox cboFixedMode2;
        private TextBox txtCommentMarker;
        private Label label13;
        private GroupBox groupBox4;
        private CheckBox chkCommentAnyPlace;
        private CheckBox chkSealed;
        private ComboBox cboClassVisibility;
        private Label label8;
        private Label label21;
        private TextBox txtRecordConditionSelector;
        private ComboBox cboRecordCondition;
        private Label label19;
        private OpenFileDialog dlgOpenWizard;

        public frmWizard()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            Fireball.Windows.Forms.LineMarginRender lineMarginRender1 = new Fireball.Windows.Forms.LineMarginRender();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmWizard));
            Fireball.Windows.Forms.LineMarginRender lineMarginRender2 = new Fireball.Windows.Forms.LineMarginRender();
            this.panStep1 = new System.Windows.Forms.Panel();
            this.groupBox4 = new System.Windows.Forms.GroupBox();
            this.chkCommentAnyPlace = new System.Windows.Forms.CheckBox();
            this.label13 = new System.Windows.Forms.Label();
            this.txtCommentMarker = new System.Windows.Forms.TextBox();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.label21 = new System.Windows.Forms.Label();
            this.txtRecordConditionSelector = new System.Windows.Forms.TextBox();
            this.cboRecordCondition = new System.Windows.Forms.ComboBox();
            this.label19 = new System.Windows.Forms.Label();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.chkIgnoreEmpty = new System.Windows.Forms.CheckBox();
            this.txtIgnoreLast = new System.Windows.Forms.NumericUpDown();
            this.label14 = new System.Windows.Forms.Label();
            this.label16 = new System.Windows.Forms.Label();
            this.txtIgnoreFirst = new System.Windows.Forms.NumericUpDown();
            this.label17 = new System.Windows.Forms.Label();
            this.label20 = new System.Windows.Forms.Label();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.txtFieldLength = new System.Windows.Forms.NumericUpDown();
            this.label11 = new System.Windows.Forms.Label();
            this.cboFieldVisibility = new System.Windows.Forms.ComboBox();
            this.txtDefaultType = new System.Windows.Forms.ComboBox();
            this.txtNumberOfFields = new System.Windows.Forms.NumericUpDown();
            this.label10 = new System.Windows.Forms.Label();
            this.label9 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.panStep3 = new System.Windows.Forms.Panel();
            this.txtTemplOut = new Fireball.Windows.Forms.CodeEditorControl();
            this.sdTemplOut = new Fireball.Syntax.SyntaxDocument(this.components);
            this.cboTemplate = new System.Windows.Forms.ComboBox();
            this.cboLanguage = new System.Windows.Forms.ComboBox();
            this.label4 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.cmdSaveToFile = new System.Windows.Forms.Button();
            this.cmdToClipboard = new System.Windows.Forms.Button();
            this.label2 = new System.Windows.Forms.Label();
            this.panFields = new System.Windows.Forms.FlowLayoutPanel();
            this.panStep0 = new System.Windows.Forms.Panel();
            this.cboClassVisibility = new System.Windows.Forms.ComboBox();
            this.label8 = new System.Windows.Forms.Label();
            this.chkSealed = new System.Windows.Forms.CheckBox();
            this.groupBox5 = new System.Windows.Forms.GroupBox();
            this.txtClassName = new System.Windows.Forms.TextBox();
            this.groupBox8 = new System.Windows.Forms.GroupBox();
            this.label12 = new System.Windows.Forms.Label();
            this.cboFixedMode2 = new System.Windows.Forms.ComboBox();
            this.gbxDelimitedBy = new System.Windows.Forms.GroupBox();
            this.radDelTabs = new System.Windows.Forms.RadioButton();
            this.txtDelimiter = new System.Windows.Forms.TextBox();
            this.radDelCustom = new System.Windows.Forms.RadioButton();
            this.radDelVertBar = new System.Windows.Forms.RadioButton();
            this.radDelSemiCol = new System.Windows.Forms.RadioButton();
            this.radDelComma = new System.Windows.Forms.RadioButton();
            this.radDelimited = new System.Windows.Forms.RadioButton();
            this.radFixed = new System.Windows.Forms.RadioButton();
            this.label18 = new System.Windows.Forms.Label();
            this.picCurrent = new System.Windows.Forms.PictureBox();
            this.picNewVersion = new System.Windows.Forms.PictureBox();
            this.panStep2 = new System.Windows.Forms.Panel();
            this.cmdAddField = new System.Windows.Forms.Button();
            this.label15 = new System.Windows.Forms.Label();
            this.dlgSaveToFile = new System.Windows.Forms.SaveFileDialog();
            this.panel2 = new System.Windows.Forms.Panel();
            this.cmdTestClass = new System.Windows.Forms.Button();
            this.cmdLoad = new System.Windows.Forms.Button();
            this.cmdSave = new System.Windows.Forms.Button();
            this.cmdPreview = new System.Windows.Forms.Button();
            this.cmdBack = new System.Windows.Forms.Button();
            this.cmdNext = new System.Windows.Forms.Button();
            this.cmdReset = new System.Windows.Forms.Button();
            this.panPreview = new System.Windows.Forms.Panel();
            this.cboClassLeng = new System.Windows.Forms.ComboBox();
            this.label7 = new System.Windows.Forms.Label();
            this.pictureBox4 = new System.Windows.Forms.PictureBox();
            this.label5 = new System.Windows.Forms.Label();
            this.cmdSaveClass = new System.Windows.Forms.Button();
            this.cmdCopyClass = new System.Windows.Forms.Button();
            this.txtOutput = new Fireball.Windows.Forms.CodeEditorControl();
            this.sdClassOut = new Fireball.Syntax.SyntaxDocument(this.components);
            this.chkProperties = new System.Windows.Forms.CheckBox();
            this.dlgSaveWizard = new System.Windows.Forms.SaveFileDialog();
            this.dlgOpenWizard = new System.Windows.Forms.OpenFileDialog();
            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
            this.picDonate = new System.Windows.Forms.PictureBox();
            this.panel1 = new System.Windows.Forms.Panel();
            this.linkHome = new System.Windows.Forms.Label();
            this.pictureBox5 = new System.Windows.Forms.PictureBox();
            this.lblStep2 = new System.Windows.Forms.Label();
            this.lblStep3 = new System.Windows.Forms.Label();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.pictureBox3 = new System.Windows.Forms.PictureBox();
            this.lblStep0 = new System.Windows.Forms.Label();
            this.lblStep1 = new System.Windows.Forms.Label();
            this.picCurrStep = new System.Windows.Forms.PictureBox();
            this.picFirstDark = new System.Windows.Forms.PictureBox();
            this.panStep1.SuspendLayout();
            this.groupBox4.SuspendLayout();
            this.groupBox3.SuspendLayout();
            this.groupBox1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtIgnoreLast)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtIgnoreFirst)).BeginInit();
            this.groupBox2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtFieldLength)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtNumberOfFields)).BeginInit();
            this.panStep3.SuspendLayout();
            this.panStep0.SuspendLayout();
            this.groupBox5.SuspendLayout();
            this.groupBox8.SuspendLayout();
            this.gbxDelimitedBy.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.picCurrent)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.picNewVersion)).BeginInit();
            this.panStep2.SuspendLayout();
            this.panel2.SuspendLayout();
            this.panPreview.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.picDonate)).BeginInit();
            this.panel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.picCurrStep)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.picFirstDark)).BeginInit();
            this.SuspendLayout();
            // 
            // panStep1
            // 
            this.panStep1.BackColor = System.Drawing.Color.White;
            this.panStep1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            this.panStep1.Controls.Add(this.groupBox4);
            this.panStep1.Controls.Add(this.groupBox3);
            this.panStep1.Controls.Add(this.groupBox1);
            this.panStep1.Controls.Add(this.groupBox2);
            this.panStep1.Controls.Add(this.label1);
            this.panStep1.Location = new System.Drawing.Point(170, 0);
            this.panStep1.Name = "panStep1";
            this.panStep1.Size = new System.Drawing.Size(400, 366);
            this.panStep1.TabIndex = 2;
            this.panStep1.TabStop = true;
            this.panStep1.Visible = false;
            // 
            // groupBox4
            // 
            this.groupBox4.Controls.Add(this.chkCommentAnyPlace);
            this.groupBox4.Controls.Add(this.label13);
            this.groupBox4.Controls.Add(this.txtCommentMarker);
            this.groupBox4.Location = new System.Drawing.Point(219, 191);
            this.groupBox4.Name = "groupBox4";
            this.groupBox4.Size = new System.Drawing.Size(166, 95);
            this.groupBox4.TabIndex = 13;
            this.groupBox4.TabStop = false;
            this.groupBox4.Text = "Commented Lines";
            // 
            // chkCommentAnyPlace
            // 
            this.chkCommentAnyPlace.Checked = true;
            this.chkCommentAnyPlace.CheckState = System.Windows.Forms.CheckState.Checked;
            this.chkCommentAnyPlace.Location = new System.Drawing.Point(15, 54);
            this.chkCommentAnyPlace.Name = "chkCommentAnyPlace";
            this.chkCommentAnyPlace.Size = new System.Drawing.Size(148, 30);
            this.chkCommentAnyPlace.TabIndex = 11;
            this.chkCommentAnyPlace.Text = "The comment can have spaces or tabs at left";
            this.chkCommentAnyPlace.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.chkCommentAnyPlace.UseVisualStyleBackColor = true;
            this.chkCommentAnyPlace.CheckedChanged += new System.EventHandler(this.chkCommentAnyPlace_CheckedChanged);
            // 
            // label13
            // 
            this.label13.AutoSize = true;
            this.label13.Location = new System.Drawing.Point(12, 27);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(88, 13);
            this.label13.TabIndex = 11;
            this.label13.Text = "Comment Marker";
            // 
            // txtCommentMarker
            // 
            this.txtCommentMarker.Location = new System.Drawing.Point(106, 24);
            this.txtCommentMarker.Name = "txtCommentMarker";
            this.txtCommentMarker.Size = new System.Drawing.Size(40, 21);
            this.txtCommentMarker.TabIndex = 12;
            this.toolTip1.SetToolTip(this.txtCommentMarker, "Allow you to ignore the lines that begin with this comment marker.");
            this.txtCommentMarker.TextChanged += new System.EventHandler(this.txtCommentMarker_TextChanged);
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.label21);
            this.groupBox3.Controls.Add(this.txtRecordConditionSelector);
            this.groupBox3.Controls.Add(this.cboRecordCondition);
            this.groupBox3.Controls.Add(this.label19);
            this.groupBox3.Location = new System.Drawing.Point(19, 288);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(366, 71);
            this.groupBox3.TabIndex = 12;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Conditional Records";
            // 
            // label21
            // 
            this.label21.AutoSize = true;
            this.label21.Location = new System.Drawing.Point(47, 47);
            this.label21.Name = "label21";
            this.label21.Size = new System.Drawing.Size(131, 13);
            this.label21.TabIndex = 1018;
            this.label21.Text = "Record Condition Selector";
            // 
            // txtRecordConditionSelector
            // 
            this.txtRecordConditionSelector.Location = new System.Drawing.Point(181, 44);
            this.txtRecordConditionSelector.Name = "txtRecordConditionSelector";
            this.txtRecordConditionSelector.Size = new System.Drawing.Size(137, 21);
            this.txtRecordConditionSelector.TabIndex = 1019;
            this.toolTip1.SetToolTip(this.txtRecordConditionSelector, "The selector used with the Record Condition");
            this.txtRecordConditionSelector.TextChanged += new System.EventHandler(this.txtRecordConditionSelector_TextChanged);
            // 
            // cboRecordCondition
            // 
            this.cboRecordCondition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboRecordCondition.FormattingEnabled = true;
            this.cboRecordCondition.Location = new System.Drawing.Point(181, 20);
            this.cboRecordCondition.Name = "cboRecordCondition";
            this.cboRecordCondition.Size = new System.Drawing.Size(137, 21);
            this.cboRecordCondition.TabIndex = 1016;
            this.toolTip1.SetToolTip(this.cboRecordCondition, "Allow you to include or exclude certain records");
            this.cboRecordCondition.SelectedIndexChanged += new System.EventHandler(this.cboRecordCondition_SelectedIndexChanged);
            // 
            // label19
            // 
            this.label19.AutoSize = true;
            this.label19.Location = new System.Drawing.Point(47, 23);
            this.label19.Name = "label19";
            this.label19.Size = new System.Drawing.Size(89, 13);
            this.label19.TabIndex = 1017;
            this.label19.Text = "Record Condition";
            this.label19.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.chkIgnoreEmpty);
            this.groupBox1.Controls.Add(this.txtIgnoreLast);
            this.groupBox1.Controls.Add(this.label14);
            this.groupBox1.Controls.Add(this.label16);
            this.groupBox1.Controls.Add(this.txtIgnoreFirst);
            this.groupBox1.Controls.Add(this.label17);
            this.groupBox1.Controls.Add(this.label20);
            this.groupBox1.Location = new System.Drawing.Point(19, 191);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(194, 95);
            this.groupBox1.TabIndex = 11;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Ignore Lines";
            // 
            // chkIgnoreEmpty
            // 
            this.chkIgnoreEmpty.AutoSize = true;
            this.chkIgnoreEmpty.Location = new System.Drawing.Point(39, 70);
            this.chkIgnoreEmpty.Name = "chkIgnoreEmpty";
            this.chkIgnoreEmpty.Size = new System.Drawing.Size(118, 17);
            this.chkIgnoreEmpty.TabIndex = 1;
            this.chkIgnoreEmpty.Text = "Ignore Empty Lines";
            this.toolTip1.SetToolTip(this.chkIgnoreEmpty, "By Pass the empty lines");
            this.chkIgnoreEmpty.UseVisualStyleBackColor = true;
            this.chkIgnoreEmpty.CheckedChanged += new System.EventHandler(this.chkIgnoreEmpty_CheckedChanged);
            // 
            // txtIgnoreLast
            // 
            this.txtIgnoreLast.Location = new System.Drawing.Point(98, 43);
            this.txtIgnoreLast.Name = "txtIgnoreLast";
            this.txtIgnoreLast.Size = new System.Drawing.Size(44, 21);
            this.txtIgnoreLast.TabIndex = 8;
            this.txtIgnoreLast.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.txtIgnoreLast.ValueChanged += new System.EventHandler(this.txtIgnoreLast_ValueChanged);
            // 
            // label14
            // 
            this.label14.AutoSize = true;
            this.label14.Location = new System.Drawing.Point(148, 46);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(31, 13);
            this.label14.TabIndex = 9;
            this.label14.Text = "Lines";
            // 
            // label16
            // 
            this.label16.AutoSize = true;
            this.label16.Location = new System.Drawing.Point(10, 46);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(81, 13);
            this.label16.TabIndex = 10;
            this.label16.Text = "Ignore the Last";
            // 
            // txtIgnoreFirst
            // 
            this.txtIgnoreFirst.Location = new System.Drawing.Point(98, 17);
            this.txtIgnoreFirst.Name = "txtIgnoreFirst";
            this.txtIgnoreFirst.Size = new System.Drawing.Size(44, 21);
            this.txtIgnoreFirst.TabIndex = 0;
            this.txtIgnoreFirst.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.txtIgnoreFirst.ValueChanged += new System.EventHandler(this.txtIgnoreFirst_ValueChanged);
            // 
            // label17
            // 
            this.label17.AutoSize = true;
            this.label17.Location = new System.Drawing.Point(148, 22);
            this.label17.Name = "label17";
            this.label17.Size = new System.Drawing.Size(31, 13);
            this.label17.TabIndex = 6;
            this.label17.Text = "Lines";
            // 
            // label20
            // 
            this.label20.AutoSize = true;
            this.label20.Location = new System.Drawing.Point(9, 19);
            this.label20.Name = "label20";
            this.label20.Size = new System.Drawing.Size(82, 13);
            this.label20.TabIndex = 7;
            this.label20.Text = "Ignore the First";
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.txtFieldLength);
            this.groupBox2.Controls.Add(this.label11);
            this.groupBox2.Controls.Add(this.cboFieldVisibility);
            this.groupBox2.Controls.Add(this.txtDefaultType);
            this.groupBox2.Controls.Add(this.txtNumberOfFields);
            this.groupBox2.Controls.Add(this.label10);
            this.groupBox2.Controls.Add(this.label9);
            this.groupBox2.Controls.Add(this.label6);
            this.groupBox2.Location = new System.Drawing.Point(18, 54);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(368, 131);
            this.groupBox2.TabIndex = 0;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Fields Options";
            // 
            // txtFieldLength
            // 
            this.txtFieldLength.Location = new System.Drawing.Point(154, 48);
            this.txtFieldLength.Maximum = new decimal(new int[] {
            1000,
            0,
            0,
            0});
            this.txtFieldLength.Minimum = new decimal(new int[] {
            1,
            0,
            0,
            0});
            this.txtFieldLength.Name = "txtFieldLength";
            this.txtFieldLength.Size = new System.Drawing.Size(84, 21);
            this.txtFieldLength.TabIndex = 10;
            this.txtFieldLength.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.txtFieldLength.Value = new decimal(new int[] {
            10,
            0,
            0,
            0});
            // 
            // label11
            // 
            this.label11.AutoSize = true;
            this.label11.Location = new System.Drawing.Point(48, 51);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(103, 13);
            this.label11.TabIndex = 9;
            this.label11.Text = "Default Field Length";
            this.label11.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // cboFieldVisibility
            // 
            this.cboFieldVisibility.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboFieldVisibility.FormattingEnabled = true;
            this.cboFieldVisibility.Location = new System.Drawing.Point(154, 102);
            this.cboFieldVisibility.Name = "cboFieldVisibility";
            this.cboFieldVisibility.Size = new System.Drawing.Size(84, 21);
            this.cboFieldVisibility.TabIndex = 2;
            this.cboFieldVisibility.SelectedIndexChanged += new System.EventHandler(this.cboFieldVisibility_SelectedIndexChanged);
            // 
            // txtDefaultType
            // 
            this.txtDefaultType.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
            this.txtDefaultType.FormattingEnabled = true;
            this.txtDefaultType.Items.AddRange(new object[] {
            "String",
            "DateTime",
            "Int16",
            "Int32",
            "Int64",
            "Decimal",
            "Double",
            "Single",
            "Bool"});
            this.txtDefaultType.Location = new System.Drawing.Point(154, 75);
            this.txtDefaultType.MaxDropDownItems = 20;
            this.txtDefaultType.Name = "txtDefaultType";
            this.txtDefaultType.Size = new System.Drawing.Size(84, 21);
            this.txtDefaultType.TabIndex = 1;
            this.txtDefaultType.Text = "String";
            // 
            // txtNumberOfFields
            // 
            this.txtNumberOfFields.Location = new System.Drawing.Point(154, 21);
            this.txtNumberOfFields.Name = "txtNumberOfFields";
            this.txtNumberOfFields.Size = new System.Drawing.Size(84, 21);
            this.txtNumberOfFields.TabIndex = 0;
            this.txtNumberOfFields.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.txtNumberOfFields.Value = new decimal(new int[] {
            5,
            0,
            0,
            0});
            // 
            // label10
            // 
            this.label10.AutoSize = true;
            this.label10.Location = new System.Drawing.Point(48, 105);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(69, 13);
            this.label10.TabIndex = 5;
            this.label10.Text = "Field Visibility";
            this.label10.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // label9
            // 
            this.label9.AutoSize = true;
            this.label9.Location = new System.Drawing.Point(48, 78);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(94, 13);
            this.label9.TabIndex = 3;
            this.label9.Text = "Default Field Type";
            this.label9.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(48, 23);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(87, 13);
            this.label6.TabIndex = 1;
            this.label6.Text = "Number of Fields";
            this.label6.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.BackColor = System.Drawing.Color.White;
            this.label1.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(11, 14);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(263, 19);
            this.label1.TabIndex = 0;
            this.label1.Text = "2. Record and Fields Properties";
            // 
            // panStep3
            // 
            this.panStep3.BackColor = System.Drawing.Color.White;
            this.panStep3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            this.panStep3.Controls.Add(this.txtTemplOut);
            this.panStep3.Controls.Add(this.cboTemplate);
            this.panStep3.Controls.Add(this.cboLanguage);
            this.panStep3.Controls.Add(this.label4);
            this.panStep3.Controls.Add(this.label3);
            this.panStep3.Controls.Add(this.cmdSaveToFile);
            this.panStep3.Controls.Add(this.cmdToClipboard);
            this.panStep3.Controls.Add(this.label2);
            this.panStep3.Location = new System.Drawing.Point(170, 0);
            this.panStep3.Name = "panStep3";
            this.panStep3.Size = new System.Drawing.Size(400, 366);
            this.panStep3.TabIndex = 3;
            this.panStep3.TabStop = true;
            this.panStep3.Visible = false;
            // 
            // txtTemplOut
            // 
            this.txtTemplOut.ActiveView = Fireball.Windows.Forms.CodeEditor.ActiveView.BottomRight;
            this.txtTemplOut.AutoListPosition = null;
            this.txtTemplOut.AutoListSelectedText = "a123";
            this.txtTemplOut.AutoListVisible = false;
            this.txtTemplOut.CopyAsRTF = true;
            this.txtTemplOut.Document = this.sdTemplOut;
            this.txtTemplOut.Indent = Fireball.Windows.Forms.CodeEditor.IndentStyle.Smart;
            this.txtTemplOut.InfoTipCount = 1;
            this.txtTemplOut.InfoTipPosition = null;
            this.txtTemplOut.InfoTipSelectedIndex = 1;
            this.txtTemplOut.InfoTipVisible = false;
            lineMarginRender1.Bounds = new System.Drawing.Rectangle(0, 0, 0, 0);
            this.txtTemplOut.LineMarginRender = lineMarginRender1;
            this.txtTemplOut.Location = new System.Drawing.Point(18, 70);
            this.txtTemplOut.LockCursorUpdate = false;
            this.txtTemplOut.Name = "txtTemplOut";
            this.txtTemplOut.ParseOnPaste = true;
            this.txtTemplOut.ReadOnly = true;
            this.txtTemplOut.Saved = true;
            this.txtTemplOut.ShowGutterMargin = false;
            this.txtTemplOut.ShowLineNumbers = false;
            this.txtTemplOut.ShowScopeIndicator = false;
            this.txtTemplOut.Size = new System.Drawing.Size(367, 258);
            this.txtTemplOut.SmoothScroll = true;
            this.txtTemplOut.SplitView = false;
            this.txtTemplOut.SplitviewH = -4;
            this.txtTemplOut.SplitviewV = -4;
            this.txtTemplOut.TabGuideColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(243)))), ((int)(((byte)(234)))));
            this.txtTemplOut.TabIndex = 11;
            this.txtTemplOut.Text = "codeEditorControl1";
            this.txtTemplOut.WhitespaceColor = System.Drawing.SystemColors.ControlDark;
            // 
            // sdTemplOut
            // 
            this.sdTemplOut.Lines = new string[] {
        " "};
            this.sdTemplOut.MaxUndoBufferSize = 1;
            this.sdTemplOut.Modified = false;
            this.sdTemplOut.UndoStep = 0;
            // 
            // cboTemplate
            // 
            this.cboTemplate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboTemplate.Location = new System.Drawing.Point(70, 43);
            this.cboTemplate.Name = "cboTemplate";
            this.cboTemplate.Size = new System.Drawing.Size(176, 21);
            this.cboTemplate.Sorted = true;
            this.cboTemplate.TabIndex = 0;
            this.cboTemplate.SelectedIndexChanged += new System.EventHandler(this.cboTemplate_SelectedIndexChanged);
            // 
            // cboLanguage
            // 
            this.cboLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboLanguage.FormattingEnabled = true;
            this.cboLanguage.Items.AddRange(new object[] {
            "C#",
            "VB.NET"});
            this.cboLanguage.Location = new System.Drawing.Point(309, 43);
            this.cboLanguage.Name = "cboLanguage";
            this.cboLanguage.Size = new System.Drawing.Size(77, 21);
            this.cboLanguage.TabIndex = 1;
            this.cboLanguage.SelectedIndexChanged += new System.EventHandler(this.cboLanguage_SelectedIndexChanged);
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(257, 46);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(54, 13);
            this.label4.TabIndex = 10;
            this.label4.Text = "Language";
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(15, 46);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(51, 13);
            this.label3.TabIndex = 9;
            this.label3.Text = "Template";
            // 
            // cmdSaveToFile
            // 
            this.cmdSaveToFile.BackColor = System.Drawing.SystemColors.Control;
            this.cmdSaveToFile.Image = global::FileHelpers.WizardApp.Properties.Resources.disk;
            this.cmdSaveToFile.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdSaveToFile.Location = new System.Drawing.Point(18, 333);
            this.cmdSaveToFile.Name = "cmdSaveToFile";
            this.cmdSaveToFile.Size = new System.Drawing.Size(117, 28);
            this.cmdSaveToFile.TabIndex = 3;
            this.cmdSaveToFile.Text = "    Save to File ...";
            this.cmdSaveToFile.UseVisualStyleBackColor = true;
            this.cmdSaveToFile.Click += new System.EventHandler(this.cmdSaveToFile_Click);
            // 
            // cmdToClipboard
            // 
            this.cmdToClipboard.BackColor = System.Drawing.SystemColors.Control;
            this.cmdToClipboard.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cmdToClipboard.Image = global::FileHelpers.WizardApp.Properties.Resources.page_copy;
            this.cmdToClipboard.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdToClipboard.Location = new System.Drawing.Point(246, 333);
            this.cmdToClipboard.Name = "cmdToClipboard";
            this.cmdToClipboard.Size = new System.Drawing.Size(139, 28);
            this.cmdToClipboard.TabIndex = 2;
            this.cmdToClipboard.Text = "    Copy to Clipboard";
            this.cmdToClipboard.UseVisualStyleBackColor = true;
            this.cmdToClipboard.Click += new System.EventHandler(this.cmdToClipboard_Click);
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.BackColor = System.Drawing.Color.White;
            this.label2.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(11, 14);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(249, 19);
            this.label2.TabIndex = 0;
            this.label2.Text = "4. Save and Usage Templates";
            // 
            // panFields
            // 
            this.panFields.AutoScroll = true;
            this.panFields.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(250)))), ((int)(((byte)(250)))));
            this.panFields.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panFields.Location = new System.Drawing.Point(18, 43);
            this.panFields.Name = "panFields";
            this.panFields.Size = new System.Drawing.Size(374, 288);
            this.panFields.TabIndex = 0;
            this.panFields.TabStop = true;
            // 
            // panStep0
            // 
            this.panStep0.BackColor = System.Drawing.Color.White;
            this.panStep0.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            this.panStep0.Controls.Add(this.cboClassVisibility);
            this.panStep0.Controls.Add(this.label8);
            this.panStep0.Controls.Add(this.chkSealed);
            this.panStep0.Controls.Add(this.groupBox5);
            this.panStep0.Controls.Add(this.groupBox8);
            this.panStep0.Controls.Add(this.label18);
            this.panStep0.Controls.Add(this.picCurrent);
            this.panStep0.Controls.Add(this.picNewVersion);
            this.panStep0.Location = new System.Drawing.Point(170, 0);
            this.panStep0.Name = "panStep0";
            this.panStep0.Size = new System.Drawing.Size(400, 366);
            this.panStep0.TabIndex = 0;
            this.panStep0.TabStop = true;
            // 
            // cboClassVisibility
            // 
            this.cboClassVisibility.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboClassVisibility.FormattingEnabled = true;
            this.cboClassVisibility.Location = new System.Drawing.Point(148, 308);
            this.cboClassVisibility.Name = "cboClassVisibility";
            this.cboClassVisibility.Size = new System.Drawing.Size(84, 21);
            this.cboClassVisibility.TabIndex = 1014;
            this.toolTip1.SetToolTip(this.cboClassVisibility, "Set the visibility of your record class. ");
            this.cboClassVisibility.SelectedIndexChanged += new System.EventHandler(this.cboClassVisibility_SelectedIndexChanged);
            // 
            // label8
            // 
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(34, 311);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(109, 13);
            this.label8.TabIndex = 1015;
            this.label8.Text = "Record Class Visibility";
            this.label8.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // chkSealed
            // 
            this.chkSealed.Checked = true;
            this.chkSealed.CheckState = System.Windows.Forms.CheckState.Checked;
            this.chkSealed.Location = new System.Drawing.Point(37, 331);
            this.chkSealed.Name = "chkSealed";
            this.chkSealed.Size = new System.Drawing.Size(168, 31);
            this.chkSealed.TabIndex = 1013;
            this.chkSealed.Text = "Mark the class as sealed\r\n(better performance)";
            this.toolTip1.SetToolTip(this.chkSealed, "Enhace a bit the performance with this option");
            this.chkSealed.UseVisualStyleBackColor = true;
            this.chkSealed.CheckedChanged += new System.EventHandler(this.chkSealed_CheckedChanged);
            // 
            // groupBox5
            // 
            this.groupBox5.Controls.Add(this.txtClassName);
            this.groupBox5.Location = new System.Drawing.Point(22, 55);
            this.groupBox5.Name = "groupBox5";
            this.groupBox5.Size = new System.Drawing.Size(343, 61);
            this.groupBox5.TabIndex = 0;
            this.groupBox5.TabStop = false;
            this.groupBox5.Text = "Record Class Name";
            // 
            // txtClassName
            // 
            this.txtClassName.Location = new System.Drawing.Point(16, 26);
            this.txtClassName.Name = "txtClassName";
            this.txtClassName.Size = new System.Drawing.Size(309, 21);
            this.txtClassName.TabIndex = 0;
            this.txtClassName.Text = "YourRecordClass";
            this.toolTip1.SetToolTip(this.txtClassName, "The name of the record class. Needs to be a valid identifier");
            this.txtClassName.TextChanged += new System.EventHandler(this.txtClassName_TextChanged);
            // 
            // groupBox8
            // 
            this.groupBox8.Controls.Add(this.label12);
            this.groupBox8.Controls.Add(this.cboFixedMode2);
            this.groupBox8.Controls.Add(this.gbxDelimitedBy);
            this.groupBox8.Controls.Add(this.radDelimited);
            this.groupBox8.Controls.Add(this.radFixed);
            this.groupBox8.Location = new System.Drawing.Point(22, 120);
            this.groupBox8.Name = "groupBox8";
            this.groupBox8.Size = new System.Drawing.Size(343, 179);
            this.groupBox8.TabIndex = 1;
            this.groupBox8.TabStop = false;
            this.groupBox8.Text = "Select the Record Type";
            // 
            // label12
            // 
            this.label12.AutoSize = true;
            this.label12.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
            this.label12.Location = new System.Drawing.Point(168, 25);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(59, 13);
            this.label12.TabIndex = 10;
            this.label12.Text = "FixedMode";
            this.label12.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // cboFixedMode2
            // 
            this.cboFixedMode2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboFixedMode2.FormattingEnabled = true;
            this.cboFixedMode2.Items.AddRange(new object[] {
            "public",
            "private",
            "internal",
            "protected"});
            this.cboFixedMode2.Location = new System.Drawing.Point(227, 21);
            this.cboFixedMode2.Name = "cboFixedMode2";
            this.cboFixedMode2.Size = new System.Drawing.Size(98, 21);
            this.cboFixedMode2.TabIndex = 9;
            this.toolTip1.SetToolTip(this.cboFixedMode2, "Indicates if the engines allow to found less or more chars in the last record");
            this.cboFixedMode2.SelectedIndexChanged += new System.EventHandler(this.cboFixedMode2_SelectedIndexChanged);
            // 
            // gbxDelimitedBy
            // 
            this.gbxDelimitedBy.Controls.Add(this.radDelTabs);
            this.gbxDelimitedBy.Controls.Add(this.txtDelimiter);
            this.gbxDelimitedBy.Controls.Add(this.radDelCustom);
            this.gbxDelimitedBy.Controls.Add(this.radDelVertBar);
            this.gbxDelimitedBy.Controls.Add(this.radDelSemiCol);
            this.gbxDelimitedBy.Controls.Add(this.radDelComma);
            this.gbxDelimitedBy.Enabled = false;
            this.gbxDelimitedBy.Location = new System.Drawing.Point(47, 61);
            this.gbxDelimitedBy.Name = "gbxDelimitedBy";
            this.gbxDelimitedBy.Size = new System.Drawing.Size(226, 111);
            this.gbxDelimitedBy.TabIndex = 4;
            this.gbxDelimitedBy.TabStop = false;
            // 
            // radDelTabs
            // 
            this.radDelTabs.AutoSize = true;
            this.radDelTabs.Location = new System.Drawing.Point(15, 16);
            this.radDelTabs.Name = "radDelTabs";
            this.radDelTabs.Size = new System.Drawing.Size(109, 17);
            this.radDelTabs.TabIndex = 5;
            this.radDelTabs.Text = "Delimited by Tabs";
            this.radDelTabs.UseVisualStyleBackColor = true;
            // 
            // txtDelimiter
            // 
            this.txtDelimiter.HideSelection = false;
            this.txtDelimiter.Location = new System.Drawing.Point(177, 83);
            this.txtDelimiter.MaxLength = 4;
            this.txtDelimiter.Name = "txtDelimiter";
            this.txtDelimiter.Size = new System.Drawing.Size(30, 21);
            this.txtDelimiter.TabIndex = 10;
            // 
            // radDelCustom
            // 
            this.radDelCustom.AutoSize = true;
            this.radDelCustom.Checked = true;
            this.radDelCustom.Location = new System.Drawing.Point(15, 84);
            this.radDelCustom.Name = "radDelCustom";
            this.radDelCustom.Size = new System.Drawing.Size(153, 17);
            this.radDelCustom.TabIndex = 9;
            this.radDelCustom.TabStop = true;
            this.radDelCustom.Text = "Delimited by Custom String";
            this.radDelCustom.UseVisualStyleBackColor = true;
            // 
            // radDelVertBar
            // 
            this.radDelVertBar.AutoSize = true;
            this.radDelVertBar.Location = new System.Drawing.Point(15, 33);
            this.radDelVertBar.Name = "radDelVertBar";
            this.radDelVertBar.Size = new System.Drawing.Size(140, 17);
            this.radDelVertBar.TabIndex = 6;
            this.radDelVertBar.Text = "Delimited by Vertical Bar";
            this.radDelVertBar.UseVisualStyleBackColor = true;
            // 
            // radDelSemiCol
            // 
            this.radDelSemiCol.AutoSize = true;
            this.radDelSemiCol.Location = new System.Drawing.Point(15, 67);
            this.radDelSemiCol.Name = "radDelSemiCol";
            this.radDelSemiCol.Size = new System.Drawing.Size(135, 17);
            this.radDelSemiCol.TabIndex = 8;
            this.radDelSemiCol.Text = "Delimited by SemiColon";
            this.radDelSemiCol.UseVisualStyleBackColor = true;
            // 
            // radDelComma
            // 
            this.radDelComma.AutoSize = true;
            this.radDelComma.Location = new System.Drawing.Point(15, 50);
            this.radDelComma.Name = "radDelComma";
            this.radDelComma.Size = new System.Drawing.Size(121, 17);
            this.radDelComma.TabIndex = 7;
            this.radDelComma.Text = "Delimited by Comma";
            this.radDelComma.UseVisualStyleBackColor = true;
            // 
            // radDelimited
            // 
            this.radDelimited.AutoSize = true;
            this.radDelimited.Location = new System.Drawing.Point(19, 48);
            this.radDelimited.Name = "radDelimited";
            this.radDelimited.Size = new System.Drawing.Size(146, 17);
            this.radDelimited.TabIndex = 3;
            this.radDelimited.Text = "Delimited Record Record:";
            this.radDelimited.UseVisualStyleBackColor = true;
            this.radDelimited.CheckedChanged += new System.EventHandler(this.radDelimited_CheckedChanged);
            // 
            // radFixed
            // 
            this.radFixed.AutoSize = true;
            this.radFixed.Checked = true;
            this.radFixed.Location = new System.Drawing.Point(19, 22);
            this.radFixed.Name = "radFixed";
            this.radFixed.Size = new System.Drawing.Size(124, 17);
            this.radFixed.TabIndex = 2;
            this.radFixed.TabStop = true;
            this.radFixed.Text = "Fixed Length Record";
            this.radFixed.UseVisualStyleBackColor = true;
            this.radFixed.CheckedChanged += new System.EventHandler(this.radFixed_CheckedChanged);
            // 
            // label18
            // 
            this.label18.AutoSize = true;
            this.label18.BackColor = System.Drawing.Color.White;
            this.label18.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label18.Location = new System.Drawing.Point(11, 14);
            this.label18.Name = "label18";
            this.label18.Size = new System.Drawing.Size(218, 19);
            this.label18.TabIndex = 0;
            this.label18.Text = "1. Select the Record Type";
            // 
            // picCurrent
            // 
            this.picCurrent.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.picCurrent.BackColor = System.Drawing.Color.Transparent;
            this.picCurrent.Image = ((System.Drawing.Image)(resources.GetObject("picCurrent.Image")));
            this.picCurrent.Location = new System.Drawing.Point(251, 310);
            this.picCurrent.Name = "picCurrent";
            this.picCurrent.Size = new System.Drawing.Size(146, 53);
            this.picCurrent.TabIndex = 1011;
            this.picCurrent.TabStop = false;
            this.picCurrent.Visible = false;
            // 
            // picNewVersion
            // 
            this.picNewVersion.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.picNewVersion.BackColor = System.Drawing.Color.Transparent;
            this.picNewVersion.Cursor = System.Windows.Forms.Cursors.Hand;
            this.picNewVersion.Image = ((System.Drawing.Image)(resources.GetObject("picNewVersion.Image")));
            this.picNewVersion.Location = new System.Drawing.Point(251, 310);
            this.picNewVersion.Name = "picNewVersion";
            this.picNewVersion.Size = new System.Drawing.Size(146, 53);
            this.picNewVersion.TabIndex = 1012;
            this.picNewVersion.TabStop = false;
            this.picNewVersion.Visible = false;
            this.picNewVersion.Click += new System.EventHandler(this.picNewVersion_Click);
            // 
            // panStep2
            // 
            this.panStep2.BackColor = System.Drawing.Color.White;
            this.panStep2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            this.panStep2.Controls.Add(this.panFields);
            this.panStep2.Controls.Add(this.cmdAddField);
            this.panStep2.Controls.Add(this.label15);
            this.panStep2.Location = new System.Drawing.Point(170, 0);
            this.panStep2.Name = "panStep2";
            this.panStep2.Size = new System.Drawing.Size(400, 366);
            this.panStep2.TabIndex = 10;
            this.panStep2.TabStop = true;
            this.panStep2.Visible = false;
            // 
            // cmdAddField
            // 
            this.cmdAddField.BackColor = System.Drawing.SystemColors.Control;
            this.cmdAddField.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cmdAddField.Image = ((System.Drawing.Image)(resources.GetObject("cmdAddField.Image")));
            this.cmdAddField.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdAddField.Location = new System.Drawing.Point(18, 334);
            this.cmdAddField.Name = "cmdAddField";
            this.cmdAddField.Size = new System.Drawing.Size(101, 28);
            this.cmdAddField.TabIndex = 4;
            this.cmdAddField.Text = "   Add Field";
            this.cmdAddField.UseVisualStyleBackColor = true;
            this.cmdAddField.Click += new System.EventHandler(this.cmdAddField_Click);
            // 
            // label15
            // 
            this.label15.AutoSize = true;
            this.label15.BackColor = System.Drawing.Color.White;
            this.label15.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label15.Location = new System.Drawing.Point(11, 14);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(215, 19);
            this.label15.TabIndex = 0;
            this.label15.Text = "3. Record Fields Designer";
            // 
            // dlgSaveToFile
            // 
            this.dlgSaveToFile.DefaultExt = "cs";
            this.dlgSaveToFile.Filter = "C# files|*.cs|VB.Net Files|*.vb|All Files|*.*";
            this.dlgSaveToFile.Title = "Save the output to a file.";
            // 
            // panel2
            // 
            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel2.Controls.Add(this.cmdTestClass);
            this.panel2.Controls.Add(this.cmdLoad);
            this.panel2.Controls.Add(this.cmdSave);
            this.panel2.Controls.Add(this.cmdPreview);
            this.panel2.Controls.Add(this.cmdBack);
            this.panel2.Controls.Add(this.cmdNext);
            this.panel2.Location = new System.Drawing.Point(-10, 366);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(587, 51);
            this.panel2.TabIndex = 1000;
            // 
            // cmdTestClass
            // 
            this.cmdTestClass.Image = global::FileHelpers.WizardApp.Properties.Resources.tick;
            this.cmdTestClass.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdTestClass.Location = new System.Drawing.Point(14, 6);
            this.cmdTestClass.Name = "cmdTestClass";
            this.cmdTestClass.Size = new System.Drawing.Size(86, 28);
            this.cmdTestClass.TabIndex = 1008;
            this.cmdTestClass.Text = "      Test Class";
            this.cmdTestClass.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdTestClass.UseVisualStyleBackColor = true;
            this.cmdTestClass.Click += new System.EventHandler(this.cmdTestClass_Click);
            // 
            // cmdLoad
            // 
            this.cmdLoad.Image = global::FileHelpers.WizardApp.Properties.Resources.folder_table;
            this.cmdLoad.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdLoad.Location = new System.Drawing.Point(105, 6);
            this.cmdLoad.Name = "cmdLoad";
            this.cmdLoad.Size = new System.Drawing.Size(82, 28);
            this.cmdLoad.TabIndex = 1102;
            this.cmdLoad.Text = "Load Info";
            this.cmdLoad.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.cmdLoad.UseVisualStyleBackColor = true;
            this.cmdLoad.Click += new System.EventHandler(this.cmdLoad_Click);
            // 
            // cmdSave
            // 
            this.cmdSave.Enabled = false;
            this.cmdSave.Image = global::FileHelpers.WizardApp.Properties.Resources.disk;
            this.cmdSave.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdSave.Location = new System.Drawing.Point(192, 6);
            this.cmdSave.Name = "cmdSave";
            this.cmdSave.Size = new System.Drawing.Size(83, 28);
            this.cmdSave.TabIndex = 1101;
            this.cmdSave.Text = "Save Info";
            this.cmdSave.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.cmdSave.UseVisualStyleBackColor = true;
            this.cmdSave.Click += new System.EventHandler(this.cmdSave_Click);
            // 
            // cmdPreview
            // 
            this.cmdPreview.Enabled = false;
            this.cmdPreview.Image = ((System.Drawing.Image)(resources.GetObject("cmdPreview.Image")));
            this.cmdPreview.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdPreview.Location = new System.Drawing.Point(480, 6);
            this.cmdPreview.Name = "cmdPreview";
            this.cmdPreview.Size = new System.Drawing.Size(91, 28);
            this.cmdPreview.TabIndex = 1011;
            this.cmdPreview.Text = "&Preview >>";
            this.cmdPreview.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.cmdPreview.UseVisualStyleBackColor = true;
            this.cmdPreview.Click += new System.EventHandler(this.cmdPreview_Click);
            // 
            // cmdBack
            // 
            this.cmdBack.Enabled = false;
            this.cmdBack.Image = ((System.Drawing.Image)(resources.GetObject("cmdBack.Image")));
            this.cmdBack.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdBack.Location = new System.Drawing.Point(304, 6);
            this.cmdBack.Name = "cmdBack";
            this.cmdBack.Size = new System.Drawing.Size(83, 28);
            this.cmdBack.TabIndex = 1009;
            this.cmdBack.Text = "   &Back";
            this.cmdBack.UseVisualStyleBackColor = true;
            this.cmdBack.Click += new System.EventHandler(this.cmdBack_Click);
            // 
            // cmdNext
            // 
            this.cmdNext.Image = ((System.Drawing.Image)(resources.GetObject("cmdNext.Image")));
            this.cmdNext.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdNext.Location = new System.Drawing.Point(392, 6);
            this.cmdNext.Name = "cmdNext";
            this.cmdNext.Size = new System.Drawing.Size(83, 28);
            this.cmdNext.TabIndex = 1010;
            this.cmdNext.Text = "   &Next";
            this.cmdNext.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
            this.cmdNext.UseVisualStyleBackColor = true;
            this.cmdNext.Click += new System.EventHandler(this.cmdNext_Click);
            // 
            // cmdReset
            // 
            this.cmdReset.BackColor = System.Drawing.Color.LightSteelBlue;
            this.cmdReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.cmdReset.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(70)))), ((int)(((byte)(70)))));
            this.cmdReset.Image = ((System.Drawing.Image)(resources.GetObject("cmdReset.Image")));
            this.cmdReset.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdReset.Location = new System.Drawing.Point(38, 172);
            this.cmdReset.Name = "cmdReset";
            this.cmdReset.Size = new System.Drawing.Size(83, 25);
            this.cmdReset.TabIndex = 1100;
            this.cmdReset.Text = "      Reset All";
            this.cmdReset.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdReset.UseVisualStyleBackColor = false;
            this.cmdReset.Click += new System.EventHandler(this.cmdReset_Click);
            // 
            // panPreview
            // 
            this.panPreview.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.panPreview.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panPreview.Controls.Add(this.cboClassLeng);
            this.panPreview.Controls.Add(this.label7);
            this.panPreview.Controls.Add(this.pictureBox4);
            this.panPreview.Controls.Add(this.label5);
            this.panPreview.Controls.Add(this.cmdSaveClass);
            this.panPreview.Controls.Add(this.cmdCopyClass);
            this.panPreview.Controls.Add(this.txtOutput);
            this.panPreview.Controls.Add(this.chkProperties);
            this.panPreview.Location = new System.Drawing.Point(568, 0);
            this.panPreview.Name = "panPreview";
            this.panPreview.Size = new System.Drawing.Size(2, 412);
            this.panPreview.TabIndex = 1002;
            // 
            // cboClassLeng
            // 
            this.cboClassLeng.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.cboClassLeng.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboClassLeng.FormattingEnabled = true;
            this.cboClassLeng.Items.AddRange(new object[] {
            "C#",
            "VB.NET"});
            this.cboClassLeng.Location = new System.Drawing.Point(-63, 30);
            this.cboClassLeng.Name = "cboClassLeng";
            this.cboClassLeng.Size = new System.Drawing.Size(60, 21);
            this.cboClassLeng.TabIndex = 1004;
            this.cboClassLeng.SelectedIndexChanged += new System.EventHandler(this.cboClassLeng_SelectedIndexChanged);
            // 
            // label7
            // 
            this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(-120, 34);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(54, 13);
            this.label7.TabIndex = 1005;
            this.label7.Text = "Language";
            // 
            // pictureBox4
            // 
            this.pictureBox4.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox4.Image")));
            this.pictureBox4.Location = new System.Drawing.Point(5, -1);
            this.pictureBox4.Name = "pictureBox4";
            this.pictureBox4.Size = new System.Drawing.Size(32, 32);
            this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
            this.pictureBox4.TabIndex = 1003;
            this.pictureBox4.TabStop = false;
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.BackColor = System.Drawing.Color.Transparent;
            this.label5.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label5.ForeColor = System.Drawing.Color.Navy;
            this.label5.Location = new System.Drawing.Point(51, 6);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(184, 19);
            this.label5.TabIndex = 1002;
            this.label5.Text = "Record Class Preview";
            // 
            // cmdSaveClass
            // 
            this.cmdSaveClass.Image = global::FileHelpers.WizardApp.Properties.Resources.disk;
            this.cmdSaveClass.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdSaveClass.Location = new System.Drawing.Point(5, 371);
            this.cmdSaveClass.Name = "cmdSaveClass";
            this.cmdSaveClass.Size = new System.Drawing.Size(92, 28);
            this.cmdSaveClass.TabIndex = 11;
            this.cmdSaveClass.Text = "Save to File";
            this.cmdSaveClass.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.cmdSaveClass.UseVisualStyleBackColor = true;
            this.cmdSaveClass.Click += new System.EventHandler(this.cmdSaveClass_Click);
            // 
            // cmdCopyClass
            // 
            this.cmdCopyClass.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cmdCopyClass.Image = ((System.Drawing.Image)(resources.GetObject("cmdCopyClass.Image")));
            this.cmdCopyClass.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.cmdCopyClass.Location = new System.Drawing.Point(103, 371);
            this.cmdCopyClass.Name = "cmdCopyClass";
            this.cmdCopyClass.Size = new System.Drawing.Size(93, 28);
            this.cmdCopyClass.TabIndex = 11;
            this.cmdCopyClass.Text = "      Copy Class";
            this.cmdCopyClass.UseVisualStyleBackColor = true;
            this.cmdCopyClass.Click += new System.EventHandler(this.cmdCopyClass_Click);
            // 
            // txtOutput
            // 
            this.txtOutput.ActiveView = Fireball.Windows.Forms.CodeEditor.ActiveView.BottomRight;
            this.txtOutput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.txtOutput.AutoListPosition = null;
            this.txtOutput.AutoListSelectedText = "a123";
            this.txtOutput.AutoListVisible = false;
            this.txtOutput.CopyAsRTF = false;
            this.txtOutput.Document = this.sdClassOut;
            this.txtOutput.FontSize = 9F;
            this.txtOutput.Indent = Fireball.Windows.Forms.CodeEditor.IndentStyle.Smart;
            this.txtOutput.InfoTipCount = 1;
            this.txtOutput.InfoTipPosition = null;
            this.txtOutput.InfoTipSelectedIndex = 1;
            this.txtOutput.InfoTipVisible = false;
            lineMarginRender2.Bounds = new System.Drawing.Rectangle(0, 0, 0, 0);
            this.txtOutput.LineMarginRender = lineMarginRender2;
            this.txtOutput.Location = new System.Drawing.Point(3, 53);
            this.txtOutput.LockCursorUpdate = false;
            this.txtOutput.Name = "txtOutput";
            this.txtOutput.ParseOnPaste = true;
            this.txtOutput.ReadOnly = true;
            this.txtOutput.Saved = true;
            this.txtOutput.ShowGutterMargin = false;
            this.txtOutput.ShowLineNumbers = false;
            this.txtOutput.ShowScopeIndicator = false;
            this.txtOutput.Size = new System.Drawing.Size(0, 312);
            this.txtOutput.SmoothScroll = false;
            this.txtOutput.SplitView = false;
            this.txtOutput.SplitviewH = -4;
            this.txtOutput.SplitviewV = -4;
            this.txtOutput.TabGuideColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(243)))), ((int)(((byte)(234)))));
            this.txtOutput.TabIndex = 1006;
            this.txtOutput.TabSize = 3;
            this.txtOutput.WhitespaceColor = System.Drawing.SystemColors.ControlDark;
            // 
            // sdClassOut
            // 
            this.sdClassOut.Lines = new string[] {
        " "};
            this.sdClassOut.MaxUndoBufferSize = 1;
            this.sdClassOut.Modified = false;
            this.sdClassOut.UndoStep = 0;
            // 
            // chkProperties
            // 
            this.chkProperties.AutoSize = true;
            this.chkProperties.Location = new System.Drawing.Point(6, 36);
            this.chkProperties.Name = "chkProperties";
            this.chkProperties.Size = new System.Drawing.Size(111, 17);
            this.chkProperties.TabIndex = 1007;
            this.chkProperties.Text = "Create Properties";
            this.chkProperties.UseVisualStyleBackColor = true;
            this.chkProperties.CheckedChanged += new System.EventHandler(this.chkProperties_CheckedChanged);
            // 
            // dlgSaveWizard
            // 
            this.dlgSaveWizard.DefaultExt = "fhw";
            this.dlgSaveWizard.Filter = "File Helpers Wizard (*.fhw) |*.fhw";
            this.dlgSaveWizard.Title = "Save the Record Info to a File";
            // 
            // dlgOpenWizard
            // 
            this.dlgOpenWizard.DefaultExt = "fhw";
            this.dlgOpenWizard.FileName = "openFileDialog1";
            this.dlgOpenWizard.Filter = "File Helpers Wizard (*.fhw) |*.fhw";
            this.dlgOpenWizard.Title = "Load a Previous Record info";
            // 
            // toolTip1
            // 
            this.toolTip1.IsBalloon = true;
            this.toolTip1.ShowAlways = true;
            this.toolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
            this.toolTip1.ToolTipTitle = "FileHelpers Wizard";
            // 
            // picDonate
            // 
            this.picDonate.Cursor = System.Windows.Forms.Cursors.Hand;
            this.picDonate.Image = ((System.Drawing.Image)(resources.GetObject("picDonate.Image")));
            this.picDonate.Location = new System.Drawing.Point(469, 0);
            this.picDonate.Name = "picDonate";
            this.picDonate.Size = new System.Drawing.Size(100, 36);
            this.picDonate.TabIndex = 1010;
            this.picDonate.TabStop = false;
            this.toolTip1.SetToolTip(this.picDonate, "Is day by day harder to main the library.\r\nClick here to know a little about\r\nabo" +
                    "ut what you can donate to the project.\r\n\r\nSome money will keep FileHelpers alive" +
                    "\r\n\r\nThanks");
            this.picDonate.Click += new System.EventHandler(this.picDonate_Click);
            // 
            // panel1
            // 
            this.panel1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel1.BackgroundImage")));
            this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            this.panel1.Controls.Add(this.linkHome);
            this.panel1.Controls.Add(this.pictureBox5);
            this.panel1.Controls.Add(this.lblStep2);
            this.panel1.Controls.Add(this.lblStep3);
            this.panel1.Controls.Add(this.pictureBox1);
            this.panel1.Controls.Add(this.cmdReset);
            this.panel1.Controls.Add(this.pictureBox3);
            this.panel1.Controls.Add(this.lblStep0);
            this.panel1.Controls.Add(this.lblStep1);
            this.panel1.Controls.Add(this.picCurrStep);
            this.panel1.Controls.Add(this.picFirstDark);
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(172, 366);
            this.panel1.TabIndex = 9;
            this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
            // 
            // linkHome
            // 
            this.linkHome.BackColor = System.Drawing.Color.Transparent;
            this.linkHome.Location = new System.Drawing.Point(-1, -1);
            this.linkHome.Name = "linkHome";
            this.linkHome.Size = new System.Drawing.Size(165, 68);
            this.linkHome.TabIndex = 1010;
            this.linkHome.Click += new System.EventHandler(this.linkHome_Click);
            // 
            // pictureBox5
            // 
            this.pictureBox5.BackColor = System.Drawing.Color.Transparent;
            this.pictureBox5.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox5.Image")));
            this.pictureBox5.Location = new System.Drawing.Point(8, 145);
            this.pictureBox5.Name = "pictureBox5";
            this.pictureBox5.Size = new System.Drawing.Size(20, 20);
            this.pictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
            this.pictureBox5.TabIndex = 13;
            this.pictureBox5.TabStop = false;
            // 
            // lblStep2
            // 
            this.lblStep2.BackColor = System.Drawing.Color.Transparent;
            this.lblStep2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblStep2.ForeColor = System.Drawing.Color.DarkGray;
            this.lblStep2.Location = new System.Drawing.Point(29, 124);
            this.lblStep2.Name = "lblStep2";
            this.lblStep2.Size = new System.Drawing.Size(135, 16);
            this.lblStep2.TabIndex = 12;
            this.lblStep2.Text = "Record Fields Designer";
            // 
            // lblStep3
            // 
            this.lblStep3.BackColor = System.Drawing.Color.Transparent;
            this.lblStep3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblStep3.ForeColor = System.Drawing.Color.DarkGray;
            this.lblStep3.Location = new System.Drawing.Point(29, 149);
            this.lblStep3.Name = "lblStep3";
            this.lblStep3.Size = new System.Drawing.Size(115, 20);
            this.lblStep3.TabIndex = 11;
            this.lblStep3.Text = "Live Templates";
            // 
            // pictureBox1
            // 
            this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
            this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
            this.pictureBox1.Location = new System.Drawing.Point(8, 120);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(20, 20);
            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
            this.pictureBox1.TabIndex = 8;
            this.pictureBox1.TabStop = false;
            // 
            // pictureBox3
            // 
            this.pictureBox3.BackColor = System.Drawing.Color.Transparent;
            this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image")));
            this.pictureBox3.Location = new System.Drawing.Point(8, 95);
            this.pictureBox3.Name = "pictureBox3";
            this.pictureBox3.Size = new System.Drawing.Size(20, 20);
            this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
            this.pictureBox3.TabIndex = 9;
            this.pictureBox3.TabStop = false;
            // 
            // lblStep0
            // 
            this.lblStep0.BackColor = System.Drawing.Color.Transparent;
            this.lblStep0.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblStep0.ForeColor = System.Drawing.Color.White;
            this.lblStep0.Location = new System.Drawing.Point(29, 73);
            this.lblStep0.Name = "lblStep0";
            this.lblStep0.Size = new System.Drawing.Size(130, 20);
            this.lblStep0.TabIndex = 10;
            this.lblStep0.Text = "Record Properties";
            // 
            // lblStep1
            // 
            this.lblStep1.BackColor = System.Drawing.Color.Transparent;
            this.lblStep1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblStep1.ForeColor = System.Drawing.Color.DarkGray;
            this.lblStep1.Location = new System.Drawing.Point(29, 99);
            this.lblStep1.Name = "lblStep1";
            this.lblStep1.Size = new System.Drawing.Size(130, 16);
            this.lblStep1.TabIndex = 9;
            this.lblStep1.Text = "Common Properties";
            // 
            // picCurrStep
            // 
            this.picCurrStep.BackColor = System.Drawing.Color.Transparent;
            this.picCurrStep.Image = ((System.Drawing.Image)(resources.GetObject("picCurrStep.Image")));
            this.picCurrStep.Location = new System.Drawing.Point(8, 70);
            this.picCurrStep.Name = "picCurrStep";
            this.picCurrStep.Size = new System.Drawing.Size(20, 20);
            this.picCurrStep.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
            this.picCurrStep.TabIndex = 7;
            this.picCurrStep.TabStop = false;
            // 
            // picFirstDark
            // 
            this.picFirstDark.BackColor = System.Drawing.Color.Transparent;
            this.picFirstDark.Image = ((System.Drawing.Image)(resources.GetObject("picFirstDark.Image")));
            this.picFirstDark.Location = new System.Drawing.Point(8, 70);
            this.picFirstDark.Name = "picFirstDark";
            this.picFirstDark.Size = new System.Drawing.Size(20, 20);
            this.picFirstDark.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
            this.picFirstDark.TabIndex = 4;
            this.picFirstDark.TabStop = false;
            // 
            // frmWizard
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
            this.ClientSize = new System.Drawing.Size(569, 406);
            this.Controls.Add(this.picDonate);
            this.Controls.Add(this.panPreview);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.panStep1);
            this.Controls.Add(this.panStep2);
            this.Controls.Add(this.panStep3);
            this.Controls.Add(this.panStep0);
            this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Location = new System.Drawing.Point(50, 120);
            this.MaximumSize = new System.Drawing.Size(1024, 440);
            this.MinimumSize = new System.Drawing.Size(577, 440);
            this.Name = "frmWizard";
            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
            this.Text = "FileHelpers - Record Class Wizard v2.0";
            this.Resize += new System.EventHandler(this.frmWizard_Resize);
            this.Activated += new System.EventHandler(this.frmWizard_Activated);
            this.Load += new System.EventHandler(this.frmWizard_Load);
            this.panStep1.ResumeLayout(false);
            this.panStep1.PerformLayout();
            this.groupBox4.ResumeLayout(false);
            this.groupBox4.PerformLayout();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtIgnoreLast)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtIgnoreFirst)).EndInit();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtFieldLength)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtNumberOfFields)).EndInit();
            this.panStep3.ResumeLayout(false);
            this.panStep3.PerformLayout();
            this.panStep0.ResumeLayout(false);
            this.panStep0.PerformLayout();
            this.groupBox5.ResumeLayout(false);
            this.groupBox5.PerformLayout();
            this.groupBox8.ResumeLayout(false);
            this.groupBox8.PerformLayout();
            this.gbxDelimitedBy.ResumeLayout(false);
            this.gbxDelimitedBy.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.picCurrent)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.picNewVersion)).EndInit();
            this.panStep2.ResumeLayout(false);
            this.panStep2.PerformLayout();
            this.panel2.ResumeLayout(false);
            this.panPreview.ResumeLayout(false);
            this.panPreview.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.picDonate)).EndInit();
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.picCurrStep)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.picFirstDark)).EndInit();
            this.ResumeLayout(false);

        }
        #endregion

        #endregion

  


        WizardInfo mWizardInfo = new WizardInfo();


        private void frmWizard_Load(object sender, EventArgs e)
        {
            mMoving = true;
            txtClassName.SelectAll();
            cboFixedMode2.DataSource = Enum.GetValues(typeof(FixedMode));
            
            cboFieldVisibility.DataSource = Enum.GetValues(typeof(NetVisibility));
           
            cboClassVisibility.DataSource = new NetVisibility[] { NetVisibility.Public, NetVisibility.Internal};
            cboRecordCondition.DataSource = Enum.GetValues(typeof(RecordCondition));
            mMoving = false;

        }

        bool mFirstTime = true;


        bool mMoving = false;
        private void cmdNext_Click(object sender, EventArgs e)
        {
            mMoving = true;
            if (panStep0.Visible)
            {
                if (ProcessStep0())
                {
                    panStep1.Show();
                    lblStep1.ForeColor = Color.White;

                    picCurrStep.Top += 25;

                    panStep0.Hide();
                    lblStep0.ForeColor = Color.DarkGray;

                    txtNumberOfFields.Focus();
                    cmdBack.Enabled = true;

                    if (mWizardInfo.ClassBuilder != null)
                        ReLoadPreview();
                }
            }
            else if (panStep1.Visible)
            {
                if (ProcessStep1())
                {
                    panStep2.Show();
                    lblStep2.ForeColor = Color.White;

                    picCurrStep.Top += 25;

                    panStep1.Hide();
                    lblStep1.ForeColor = Color.DarkGray;

                    if (panFields.Controls.Count > 0)
                        panFields.Controls[0].Focus();

                    cmdSave.Enabled = true;
                }
            }
            else if (panStep2.Visible)
            {
                if (ProcessStep2())
                {
                    panStep3.Show();
                    lblStep3.ForeColor = Color.White;

                    picCurrStep.Top += 25;

                    panStep2.Hide();
                    lblStep2.ForeColor = Color.DarkGray;
                    cmdNext.Enabled = false;

                }
            }
            mMoving = false;


        }

        Type mControlType;
        Type mFieldType;

        #region "  ProcessStep0  "

        private bool ProcessStep0()
        {

            //lstFields.DataSource = mFields;

            if (txtClassName.Text.Trim().Length == 0)
            {
                MessageBox.Show("You need to define the Class Name", "Validation Error");
                txtClassName.Focus();
                return false;
            }


            if (radDelimited.Checked && radDelCustom.Checked && txtDelimiter.Text.Trim().Length == 0)
            {
                MessageBox.Show("You need to define the Delimiter if you use a Custom Delimiter", "Validation Error");
                txtDelimiter.Focus();
                return false;
            }


            ClassBuilder ant = mWizardInfo.ClassBuilder;
            if (radFixed.Checked)
            {
                if (mWizardInfo.FixedLengthBuilder != null) return true;

                mWizardInfo.ClassBuilder = new FixedLengthClassBuilder(txtClassName.Text);
                mWizardInfo.FixedLengthBuilder.FixedMode = (FixedMode)cboFixedMode2.SelectedItem;

                mWizardInfo.ClassBuilder.Visibility = (NetVisibility)Enum.Parse(typeof(NetVisibility), cboClassVisibility.Text);
                mWizardInfo.ClassBuilder.SealedClass = chkSealed.Checked;

                mControlType = typeof(FieldFixedControl);
                mFieldType = typeof(FixedFieldBuilder);

                txtFieldLength.Enabled = true;

                if (ant != null)
                {
                    mWizardInfo.ClassBuilder.ClassName = ant.ClassName;
                    mWizardInfo.ClassBuilder.GenerateProperties = ant.GenerateProperties;
                    mWizardInfo.ClassBuilder.IgnoreEmptyLines = ant.IgnoreEmptyLines;
                    mWizardInfo.ClassBuilder.IgnoreFirstLines = ant.IgnoreFirstLines;
                    mWizardInfo.ClassBuilder.IgnoreLastLines = ant.IgnoreLastLines;

                    mWizardInfo.ClassBuilder.Namespace = ant.Namespace;
                    mWizardInfo.ClassBuilder.SealedClass = ant.SealedClass;
                    mWizardInfo.ClassBuilder.Visibility = ant.Visibility;

                    foreach (FieldBuilder f in ant.Fields)
                    {
                        mWizardInfo.FixedLengthBuilder.AddField(f.FieldName, (int)txtFieldLength.Value, f.FieldType);
                        mWizardInfo.FixedLengthBuilder.LastField.FieldOptional = f.FieldOptional;
                        mWizardInfo.FixedLengthBuilder.LastField.FieldIgnored = f.FieldIgnored;
                        mWizardInfo.FixedLengthBuilder.LastField.FieldInNewLine = f.FieldInNewLine;
                        mWizardInfo.FixedLengthBuilder.LastField.FieldNullValue = f.FieldNullValue;
                        mWizardInfo.FixedLengthBuilder.LastField.TrimChars = f.TrimChars;
                        mWizardInfo.FixedLengthBuilder.LastField.TrimMode = f.TrimMode;
                        mWizardInfo.FixedLengthBuilder.LastField.Visibility = f.Visibility;
                    }
                }

            }
            else
            {
                mControlType = typeof(FieldDelimitedControl);
                mFieldType = typeof(FixedFieldBuilder);

                txtFieldLength.Enabled = false;

                string delimiter = string.Empty;

                if (radDelCustom.Checked)
                    delimiter = txtDelimiter.Text;
                else if (radDelComma.Checked)
                    delimiter = ",";
                else if (radDelSemiCol.Checked)
                    delimiter = ";";
                else if (radDelTabs.Checked)
                    delimiter = "\t";
                else if (radDelVertBar.Checked)
                    delimiter = "|";

                if (ant is DelimitedClassBuilder)
                {
                    mWizardInfo.DelimitedBuilder.Delimiter = delimiter;
                    return true;
                }

                mWizardInfo.ClassBuilder = new DelimitedClassBuilder(txtClassName.Text, delimiter);
                if (ant != null)
                {
                    mWizardInfo.ClassBuilder.ClassName = ant.ClassName;
                    mWizardInfo.ClassBuilder.GenerateProperties = ant.GenerateProperties;
                    mWizardInfo.ClassBuilder.IgnoreEmptyLines = ant.IgnoreEmptyLines;
                    mWizardInfo.ClassBuilder.IgnoreFirstLines = ant.IgnoreFirstLines;
                    mWizardInfo.ClassBuilder.IgnoreLastLines = ant.IgnoreLastLines;

                    mWizardInfo.ClassBuilder.Namespace = ant.Namespace;
                    mWizardInfo.ClassBuilder.SealedClass = ant.SealedClass;
                    mWizardInfo.ClassBuilder.Visibility = ant.Visibility;

                    foreach (FieldBuilder f in ant.Fields)
                    {
                        mWizardInfo.DelimitedBuilder.AddField(f.FieldName, f.FieldType);
                        mWizardInfo.DelimitedBuilder.LastField.FieldOptional = f.FieldOptional;
                        mWizardInfo.DelimitedBuilder.LastField.FieldIgnored = f.FieldIgnored;
                        mWizardInfo.DelimitedBuilder.LastField.FieldInNewLine = f.FieldInNewLine;
                        mWizardInfo.DelimitedBuilder.LastField.FieldNullValue = f.FieldNullValue;
                        mWizardInfo.DelimitedBuilder.LastField.TrimChars = f.TrimChars;
                        mWizardInfo.DelimitedBuilder.LastField.TrimMode = f.TrimMode;
                        mWizardInfo.DelimitedBuilder.LastField.Visibility = f.Visibility;
                    }
                }

            }


            cboFieldVisibility.DataSource = Enum.GetValues(typeof(NetVisibility));
            cboFieldVisibility.SelectedItem = mWizardInfo.FieldVisibility;

            cboClassVisibility.DataSource = Enum.GetValues(typeof(NetVisibility));
            cboClassVisibility.SelectedItem = mWizardInfo.ClassBuilder.Visibility;

            return true;
        }

        #endregion

        #region "  ProcessStep1  "

        private bool ProcessStep1()
        {
            mWizardInfo.DefaultType = txtDefaultType.Text;

            if (mWizardInfo.ClassBuilder.FieldCount == 0)
            {
                //CLEAR: dsd
                for (int i = 0; i < txtNumberOfFields.Value; i++)
                {
                    FieldBuilder field;
                    
                    if (mWizardInfo.ClassBuilder is DelimitedClassBuilder)
                        field = mWizardInfo.DelimitedBuilder.AddField("Field" + (mWizardInfo.ClassBuilder.FieldCount + 1).ToString(), mWizardInfo.DefaultType);
                    else
                        field = mWizardInfo.FixedLengthBuilder.AddField("Field" + (mWizardInfo.ClassBuilder.FieldCount + 1).ToString(), (int) txtFieldLength.Value, mWizardInfo.DefaultType);

                    field.Visibility = (NetVisibility)Enum.Parse(typeof(NetVisibility), cboFieldVisibility.Text);

                }
               
                txtNumberOfFields.Enabled = false;
                txtDefaultType.Enabled = false;
                txtFieldLength.Enabled = false;

            }

            panFields.SuspendLayout();
            panFields.Controls.Clear();

            foreach (FieldBuilder info in mWizardInfo.ClassBuilder.Fields)
            {
                panFields.Controls.Add(CreateFieldControlFromInfo(info));
            }

            panFields.ResumeLayout();

            cmdPreview.Enabled = true;

            panFields.Focus();

            ExpandAndShowPreview();
            return true;
        }

        //private FieldBuilder CreateFieldInfo()
        //{
        //    FieldBuilder info = (FieldBuilder)mFieldType.InvokeMember("new", System.Reflection.BindingFlags.CreateInstance, null, null, 
        //            new object[] {});

        //    info.Visibility = (NetVisibility)Enum.Parse(typeof(NetVisibility), cboFieldVisibility.Text);

        //    return info;
        //}

        private FieldBaseControl CreateFieldControl()
        {
            FieldBuilder field;

            if (mWizardInfo.ClassBuilder is DelimitedClassBuilder)
                field = mWizardInfo.DelimitedBuilder.AddField("Field" + (mWizardInfo.ClassBuilder.FieldCount + 1).ToString(), mWizardInfo.DefaultType);
            else
                field = mWizardInfo.FixedLengthBuilder.AddField("Field" + (mWizardInfo.ClassBuilder.FieldCount + 1).ToString(), (int) txtFieldLength.Value, mWizardInfo.DefaultType);

            field.Visibility = (NetVisibility)Enum.Parse(typeof(NetVisibility), cboFieldVisibility.Text);

            return CreateFieldControlFromInfo(field);
        }

        private FieldBaseControl CreateFieldControlFromInfo(FieldBuilder info)
        {
            FieldBaseControl ctrl = (FieldBaseControl)mControlType.InvokeMember("new", System.Reflection.BindingFlags.CreateInstance, null, null, null);
            ctrl.FieldInfo = info;

            ctrl.FieldInfoReload();
            ctrl.InfoChanged += new EventHandler(FieldControlChange);
            ctrl.OrderChanged += new EventHandler(FieldControlOrderChange);

            return ctrl;
        }


        #endregion

        #region "  ProcessStep2  "

        private bool ProcessStep2()
        {
            cboLanguage.SelectedIndex = 0;

            ReloadTemplates();
            return true;
        }


        //ArrayList mTemplates = new ArrayList();

        private void ReloadTemplates()
        {
            mLoading = true;

            if (cboLanguage.SelectedIndex == 0)
            {
                CodeEditorSyntaxLoader.SetSyntax(txtTemplOut, SyntaxLanguage.VBNET);
                CodeEditorSyntaxLoader.SetSyntax(txtTemplOut, SyntaxLanguage.CSharp);
            }
            else
            {
                CodeEditorSyntaxLoader.SetSyntax(txtTemplOut, SyntaxLanguage.CSharp);
                CodeEditorSyntaxLoader.SetSyntax(txtTemplOut, SyntaxLanguage.VBNET);
            }

            string lengPrefix;

            switch (cboLanguage.SelectedIndex)
            {
                case 0:
                    lengPrefix = "CS -";
                    break;

                case 1:
                    lengPrefix = "VB -";
                    break;

                default:
                    lengPrefix = "";
                    break;
            }

            DirectoryInfo di = new DirectoryInfo(Path.GetDirectoryName(Application.ExecutablePath) + @"\Templates");

            FileInfo[] files = di.GetFiles(lengPrefix + "*.tpl");

            TemplateInfo[] templates = new TemplateInfo[files.Length];

            for (int i = 0; i < files.Length; i++)
            {
                templates[i] = new TemplateInfo();
                templates[i].TemplateName = files[i].Name.Remove(0, lengPrefix.Length).Replace(".tpl", "").Trim();
                templates[i].TemplateBody = File.ReadAllText(files[i].FullName);
            }

            cboTemplate.Items.Clear();
            foreach (TemplateInfo temp in templates)
            {
                cboTemplate.Items.Add(temp);
            }

            mLoading = false;

            if (cboTemplate.Items.Count > 0)
            {
                cboTemplate.SelectedIndex = 0;
                ShowTemplate((TemplateInfo)cboTemplate.SelectedItem);
            }


        }

        #endregion

        void FieldControlChange(object sender, EventArgs e)
        {
            ExpandAndShowPreview();
        }

        void FieldControlOrderChange(object sender, EventArgs e)
        {
            // CLEAR: JEJEJ
            // mWizardInfo.LoadFields(panFields.Controls);
            ReloadFields();
            ExpandAndShowPreview();
        }

        private void ReloadFields()
        {
            mWizardInfo.ClassBuilder.ClearFields();

            foreach (FieldBaseControl ctrl in panFields.Controls)
            {
                if (mWizardInfo.DelimitedBuilder != null)
                    mWizardInfo.DelimitedBuilder.AddField((DelimitedFieldBuilder) ctrl.FieldInfo);
                else
                    mWizardInfo.FixedLengthBuilder.AddField((FixedFieldBuilder) ctrl.FieldInfo);
            }
        }

        private void cmdBack_Click(object sender, EventArgs e)
        {

            if (panStep1.Visible)
            {
                panStep0.Show();
                lblStep0.ForeColor = Color.White;

                picCurrStep.Top -= 25;

                panStep1.Hide();
                lblStep1.ForeColor = Color.DarkGray;

                txtClassName.Focus();
                cmdBack.Enabled = false;
            }
            else if (panStep2.Visible)
            {
                panStep1.Show();
                lblStep1.ForeColor = Color.White;

                picCurrStep.Top -= 25;

                panStep2.Hide();
                lblStep2.ForeColor = Color.DarkGray;

                txtDefaultType.Focus();
            }
            else if (panStep3.Visible)
            {
                panStep2.Show();
                lblStep2.ForeColor = Color.White;

                picCurrStep.Top -= 25;

                panStep3.Hide();
                lblStep3.ForeColor = Color.DarkGray;

                if (panFields.Controls.Count > 0)
                    panFields.Controls[0].Focus();

                cmdNext.Enabled = true;
            }

        }


        bool mExpanded = false;
        private void cmdPreview_Click(object sender, EventArgs e)
        {

            if (mExpanded)
            {
//                panPreview.Anchor = AnchorStyles.Top | AnchorStyles.Left;
                this.Width = panStep1.Right - 1;
                mExpanded = false;
                cmdPreview.Text = "&Preview >>";
            }
            else
            {
                ExpandAndShowPreview();
            }
        }

        private void ExpandAndShowPreview()
        {
            if (mExpanded == false)
            {
                this.Width = Math.Min(900, Screen.PrimaryScreen.WorkingArea.Width - 40);
                if (Left + Width > Screen.PrimaryScreen.WorkingArea.Width)
                    this.Left = 30;

                mExpanded = true;
                cmdPreview.Text = "<< &Preview";
                if (cboClassLeng.SelectedIndex == -1)
                    cboClassLeng.SelectedIndex = 0;

                panPreview.Anchor = AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Left;
            }

            ReLoadPreview();
        }

        private void ReLoadPreview()
        {
            if (mLoadingFile == false)
            {
                string output;
                switch (cboClassLeng.SelectedIndex)
                {
                    case 0:
                        output = mWizardInfo.WizardOutput(NetLanguage.CSharp);

                        if (sdClassOut.Text == output)
                            return;

                        CodeEditorSyntaxLoader.SetSyntax(txtOutput, SyntaxLanguage.VBNET);
                        CodeEditorSyntaxLoader.SetSyntax(txtOutput, SyntaxLanguage.CSharp);
                        sdClassOut.Text = output;
                        break;

                    case 1:
                        output = mWizardInfo.WizardOutput(NetLanguage.VbNet);

                        if (sdClassOut.Text == output)
                            return;

                        CodeEditorSyntaxLoader.SetSyntax(txtOutput, SyntaxLanguage.CSharp);
                        CodeEditorSyntaxLoader.SetSyntax(txtOutput, SyntaxLanguage.VBNET);
                        sdClassOut.Text = output;
                        break;

                    default:
                        break;
                }
            }
        }

        private void radDelimited_CheckedChanged(object sender, EventArgs e)
        {

            gbxDelimitedBy.Enabled = radDelimited.Checked;
        }

        bool mLoading = true;

        bool mLoadingFile = false;

        private void cboTemplate_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (mLoading == false)
                ShowTemplate((TemplateInfo)cboTemplate.SelectedItem);
        }

        private void ShowTemplate(TemplateInfo templ)
        {
            if (templ == null)
                sdTemplOut.Text = "";
            else
            {
                string res = templ.TemplateBody;
                res = res.Replace("${ClassName}", mWizardInfo.ClassBuilder.ClassName);

                sdTemplOut.Text = res;
                //txtTemplOut.Text = res;

            }

        }

        private void cboLanguage_SelectedIndexChanged(object sender, EventArgs e)
        {
            ReloadTemplates();
        }

        private void cmdToClipboard_Click(object sender, EventArgs e)
        {
            Clipboard.SetText(sdTemplOut.Text);
        }

        private void cmdSaveToFile_Click(object sender, EventArgs e)
        {
            try
            {
                if (RegConfig.HasValue("WizardTemplatePath"))
                    dlgSaveToFile.InitialDirectory = RegConfig.GetStringValue("WizardTemplatePath", "");
            }
            catch
            {}

            dlgSaveToFile.FilterIndex = cboLanguage.SelectedIndex + 1;
            dlgSaveToFile.FileName = "TemplateOur";

            if (dlgSaveToFile.ShowDialog() == DialogResult.OK)
            {
                File.WriteAllText(dlgSaveToFile.FileName, sdTemplOut.Text);
                RegConfig.SetStringValue("WizardTemplatePath", Path.GetDirectoryName(dlgSaveToFile.FileName));
            }

        }

        private void cmdCopyClass_Click(object sender, EventArgs e)
        {
            Clipboard.SetText(sdClassOut.Text);
        }

        private void cmdSaveClass_Click(object sender, EventArgs e)
        {
            try
            {
                if (RegConfig.HasValue("WizardClassDir"))
                    dlgSaveToFile.InitialDirectory = RegConfig.GetStringValue("WizardClassDir", "");
            }
            catch 
            {}

            dlgSaveToFile.FilterIndex = cboClassLeng.SelectedIndex + 1;
            dlgSaveToFile.FileName = txtClassName.Text;

            if (dlgSaveToFile.ShowDialog() == DialogResult.OK)
            {
                File.WriteAllText(dlgSaveToFile.FileName, sdClassOut.Text);
                RegConfig.SetStringValue("WizardClassDir", Path.GetDirectoryName(dlgSaveToFile.FileName));
            }
        }

        private void cboClassLeng_SelectedIndexChanged(object sender, EventArgs e)
        {
            ReLoadPreview();
        }

        private void cmdAddField_Click(object sender, EventArgs e)
        {
            FieldBaseControl ctrl = CreateFieldControl();

            //CLEAR:dsds
            //mWizardInfo.Fields.Add(ctrl.FieldInfo);
            panFields.Controls.Add(ctrl);

            ReLoadPreview();
        }

        private void cmdSave_Click(object sender, EventArgs e)
        {
            dlgOpenWizard.FileName = "";

            try
            {
                if (RegConfig.HasValue("WizardOpenDir"))
                    dlgSaveWizard.InitialDirectory = RegConfig.GetStringValue("WizardOpenDir", "");
            }
            catch
            { }

            dlgSaveWizard.FileName = txtClassName.Text;
            if (dlgSaveWizard.ShowDialog() == DialogResult.OK)
            {
                RegConfig.SetStringValue("WizardOpenDir", Path.GetDirectoryName(dlgSaveWizard.FileName));
                mWizardInfo.ClassBuilder.SaveToXml(dlgSaveWizard.FileName);
            }
        }

        private void cmdLoad_Click(object sender, EventArgs e)
        {
            dlgOpenWizard.FileName = "";

            try
            {
                if (RegConfig.HasValue("WizardOpenDir"))
                    dlgOpenWizard.InitialDirectory = RegConfig.GetStringValue("WizardOpenDir", "");
            }
            catch 
            {}

            if (dlgOpenWizard.ShowDialog() == DialogResult.OK)
            {
                RegConfig.SetStringValue("WizardOpenDir", Path.GetDirectoryName(dlgOpenWizard.FileName));

                mLoadingFile = true;
                Application.DoEvents();
                cmdSave.Enabled = true;

                mWizardInfo.ClassBuilder = ClassBuilder.LoadFromXml(dlgOpenWizard.FileName);

                Application.DoEvents();

                WizardToControls();

                Application.DoEvents();

                if (mWizardInfo.ClassBuilder is FixedLengthClassBuilder)
                {
                    radFixed.Checked = true;
                    mControlType = typeof(FieldFixedControl);
                    mFieldType = typeof(FixedFieldBuilder);

                    txtFieldLength.Enabled = true;

                }
                else
                {
                    txtFieldLength.Enabled = false;

                    radDelimited.Checked = true;

                    mControlType = typeof(FieldDelimitedControl);
                    mFieldType = typeof(DelimitedFieldBuilder);

                    txtDelimiter.Text = "";
                    string delimiter = mWizardInfo.DelimitedBuilder.Delimiter;

                    if (delimiter == "|")
                        radDelVertBar.Checked = true;
                    else if (delimiter  == ",")
                        radDelComma.Checked = true;
                    else if (delimiter == ";")
                        radDelSemiCol.Checked = true;
                    else if (delimiter == "\t")
                        radDelTabs.Checked = true;
                    else
                    {
                        radDelCustom.Checked = true;
                        txtDelimiter.Text = delimiter;
                    }
                }


                panFields.SuspendLayout();
                panFields.Controls.Clear();

                foreach (FieldBuilder info in mWizardInfo.ClassBuilder.Fields)
                {
                    panFields.Controls.Add(CreateFieldControlFromInfo(info));
                }

                panFields.ResumeLayout();

                cmdPreview.Enabled = true;

                panFields.Focus();

                mLoadingFile = false;


                ExpandAndShowPreview();

            }

        }

        private void WizardToControls()
        {

            txtClassName.Text = mWizardInfo.ClassBuilder.ClassName;

            txtDefaultType.Text = mWizardInfo.DefaultType;
            txtNumberOfFields.Value = mWizardInfo.ClassBuilder.FieldCount;

            txtDefaultType.Enabled = false;
            txtNumberOfFields.Enabled = false;

            txtIgnoreFirst.Value = mWizardInfo.ClassBuilder.IgnoreFirstLines;
            txtIgnoreLast.Value = mWizardInfo.ClassBuilder.IgnoreLastLines;
            chkIgnoreEmpty.Checked = mWizardInfo.ClassBuilder.IgnoreEmptyLines;
            
            cboFieldVisibility.SelectedItem = mWizardInfo.FieldVisibility;
            cboClassVisibility.SelectedItem = mWizardInfo.ClassBuilder.Visibility;
            cboRecordCondition.SelectedItem = mWizardInfo.ClassBuilder.RecordCondition.Condition;
            txtRecordConditionSelector.Text = mWizardInfo.ClassBuilder.RecordCondition.Selector;

            chkSealed.Checked = mWizardInfo.ClassBuilder.SealedClass;
            chkProperties.Checked = mWizardInfo.ClassBuilder.GenerateProperties;

            txtCommentMarker.Text = mWizardInfo.ClassBuilder.IgnoreCommentedLines.CommentMarker;
            chkCommentAnyPlace.Checked = mWizardInfo.ClassBuilder.IgnoreCommentedLines.InAnyPlace;

        }

        private void cboFieldVisibility_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (mMoving == false)
            {
                mWizardInfo.FieldVisibility = (NetVisibility)Enum.Parse(typeof(NetVisibility), cboFieldVisibility.Text);
                if (mWizardInfo.ClassBuilder.FieldCount > 0)
                    foreach (FieldBuilder info in mWizardInfo.ClassBuilder.Fields)
                        info.Visibility = mWizardInfo.FieldVisibility;

                ReLoadPreview();
            }
        }

        private void txtClassName_TextChanged(object sender, EventArgs e)
        {
            if  (mWizardInfo.ClassBuilder != null)
            {
				mWizardInfo.ClassBuilder.ClassName = txtClassName.Text;
				ReLoadPreview();
            }
        }

        private void cboClassVisibility_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (mMoving == false && mWizardInfo.ClassBuilder != null)
            {
                mWizardInfo.ClassBuilder.Visibility = (NetVisibility)Enum.Parse(typeof(NetVisibility), cboClassVisibility.Text);
                ReLoadPreview();
            }

        }

        private void chkSealed_CheckedChanged(object sender, EventArgs e)
        {
            if (mWizardInfo.ClassBuilder != null)
            {
                mWizardInfo.ClassBuilder.SealedClass = chkSealed.Checked;
                ReLoadPreview();
            }
        }

        private void txtIgnoreFirst_ValueChanged(object sender, EventArgs e)
        {
            mWizardInfo.ClassBuilder.IgnoreFirstLines = (int)txtIgnoreFirst.Value;
            ReLoadPreview();
        }

        private void txtIgnoreLast_ValueChanged(object sender, EventArgs e)
        {
            mWizardInfo.ClassBuilder.IgnoreLastLines = (int)txtIgnoreLast.Value;
            ReLoadPreview();
        }

        private void chkProperties_CheckedChanged(object sender, EventArgs e)
        {
            if (mWizardInfo.ClassBuilder == null)
                return;

            mWizardInfo.ClassBuilder.GenerateProperties = chkProperties.Checked;
            ReLoadPreview();
        }

        private void chkIgnoreEmpty_CheckedChanged(object sender, EventArgs e)
        {
            mWizardInfo.ClassBuilder.IgnoreEmptyLines = chkIgnoreEmpty.Checked;
            ReLoadPreview();
        }

        private void cmdTestClass_Click(object sender, EventArgs e)
        {
            frmDataPreview frm = new frmDataPreview(sdClassOut.Text, cboClassLeng.SelectedIndex);
            frm.ShowDialog();
            frm.Dispose();
        }



        private void picDonate_Click(object sender, EventArgs e)
        {
            frmDonate frm = new frmDonate();
            frm.ShowDialog();
            frm.Dispose();
        }

        private void linkHome_Click(object sender, EventArgs e)
        {
            ProcessStartInfo info = new ProcessStartInfo("\"http://www.filehelpers.com\"");
            info.CreateNoWindow = false;
            info.UseShellExecute = true;
            Process.Start(info);
        }

        private void frmWizard_Activated(object sender, EventArgs e)
        {
            if (mFirstTime == false)
                return;

            mFirstTime = false;

            System.Threading.ThreadPool.QueueUserWorkItem(
                delegate(object targ)
                {
                    try
                    {
                        string ver = typeof(FileHelperEngine).Assembly.GetName().Version.ToString(3);
                        VersionData verLast;
                        verLast = VersionData.GetLastVersion();

                        if (VersionData.CompararVersiones(ver, verLast.Version) >= 0)
                            picCurrent.Invoke((MethodInvoker)delegate() { picCurrent.Visible = true; });
                        else
                        {
                            picCurrent.Invoke((MethodInvoker)delegate() {
                                picNewVersion.Visible = true;
                                picNewVersion.Tag = verLast;
                                toolTip1.SetToolTip(picNewVersion, "Version: " + verLast.Version + Environment.NewLine + verLast.Description);
                            });
                        }
                    }
                    catch
                    { }
                }
            );
        }
        


        private void radFixed_CheckedChanged(object sender, EventArgs e)
        {
            cboFixedMode2.Enabled = radFixed.Checked;
        }

        private void cboFixedMode2_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (mWizardInfo.FixedLengthBuilder != null)
            {
                mWizardInfo.FixedLengthBuilder.FixedMode = (FixedMode)cboFixedMode2.SelectedItem;
                ReLoadPreview();
            }
        }

        private void picNewVersion_Click(object sender, EventArgs e)
        {
            frmLastVersion frm = new frmLastVersion((VersionData)picNewVersion.Tag);
            frm.ShowDialog();
            frm.Dispose();
        }

        private void txtCommentMarker_TextChanged(object sender, EventArgs e)
        {
            mWizardInfo.ClassBuilder.IgnoreCommentedLines.CommentMarker = txtCommentMarker.Text;
            ReLoadPreview();
        }

        private void chkCommentAnyPlace_CheckedChanged(object sender, EventArgs e)
        {
            mWizardInfo.ClassBuilder.IgnoreCommentedLines.InAnyPlace = chkCommentAnyPlace.Checked;
            ReLoadPreview();
        }

        private void txtRecordConditionSelector_TextChanged(object sender, EventArgs e)
        {
            mWizardInfo.ClassBuilder.RecordCondition.Selector = txtRecordConditionSelector.Text;
            ReLoadPreview();
        }

        private void cboRecordCondition_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (mWizardInfo.ClassBuilder != null)
            {
                mWizardInfo.ClassBuilder.RecordCondition.Condition = (RecordCondition)Enum.Parse(typeof(RecordCondition), cboRecordCondition.Text);
                ReLoadPreview();
            }
        }

        private void frmWizard_Resize(object sender, EventArgs e)
        {
            txtOutput.Width = this.Width - 585;
        }

        private void cmdReset_Click(object sender, EventArgs e)
        {
            mWizardInfo.ClassBuilder = null;
            panStep0.BringToFront();
            txtClassName.Text = "YourRecordClass";
            txtClassName.SelectAll();
            txtClassName.Focus();

            panStep0.Show();
            lblStep0.ForeColor = Color.White;

            picCurrStep.Top = picFirstDark.Top;
            panStep1.Hide();
            lblStep1.ForeColor = Color.DarkGray;
            panStep2.Hide();
            lblStep2.ForeColor = Color.DarkGray;
            panStep3.Hide();
            lblStep3.ForeColor = Color.DarkGray;

            cmdBack.Enabled = false;
            cmdNext.Enabled = true;

            txtNumberOfFields.Enabled = true;
            txtDefaultType.Enabled = true;
            cboFieldVisibility.Enabled = true;
            txtFieldLength.Enabled = true;
            cmdSave.Enabled = false;

            this.Width = panStep1.Right - 1;
            mExpanded = false;
            cmdPreview.Text = "&Preview >>";
            cmdPreview.Enabled = false;
            
            sdClassOut.Text = string.Empty;

        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }

 


    }
}
